﻿using CSRedis;
using SH.Common;
using SH.Common.DataDictionary;
using SH.Customer.Application.IApplication;
using SH.Customer.Domain.CustomerClass;
using SH.Customer.ErrorCodeEnum;
using SH.Customer.Infrastructure.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SH.Customer.Application.Application
{
    public class DicApplication : BaseApplication<Dic>, IDicApplication
    {
        private readonly IDicRepository _dicRepository;

        private readonly CSRedisClient _redis = new CSRedisClient(AppService.Configuration["redisIP"]);

        public DicApplication(IDicRepository repository, IDicRepository dicRepository) : base(repository)
        {
            _dicRepository = dicRepository;
        }

        /// <summary>
        /// 获取数据字典列表
        /// </summary>
        /// <param name="Identification"></param>
        /// <returns></returns>
        public List<Dic> DicShow(string Identification = "")
        {
            var result = _dicRepository.GetDics().Where(x => x.Identification == Identification).ToList();
            return result;
        }
    }
}
